package cn.lkk.samples.lang.inheritance.abstractClasses;

/**
 * 演示如何使用抽象类。
 * Person 类是抽象基类，Employee 与 Student 类都实现了抽象类 Person。
 */
public class PersonTest {
    public static void main(String[] args) {
        Person[] people = new Person[2];

        //填充 people 数组
        people[0] = new Employee("Harry Hacker", 5000, 1989, 10, 1);
        people[1] = new Student("Maria Morris", "computer science");


        for (Person p : people) {
            System.out.println(p.getName() + "," + p.getDescription());
        }
    }
}
